Mega Code Archive
Numeric Math Functions
1) ABS
2) ABS(-123) ABS(0) ABS(456) SIGN(-123) SIGN(0) SIGN(456)
3) ABS(x)
4) ACOS(1)
5) ACOS(x)
6) ASIN(1)
7) ASIN(x)
8) ATAN() and ATAN2() functions are return some the arctangent
9) ATAN(-1)
10) ATAN(x)
11) ATAN2(x, y)
12) BIN_TO_NUM(x)
13) BITAND(0, 1)
14) BITAND(1, 0)
15) BITAND(1, 1)
16) BITAND(1010, 1100)
17) BITAND(x, y)
18) Bin_to_num(1,0)
19) Bin_to_num(1,1)
20) Bin_to_num(1,1,1,0), bin_to_num(1,1,1,1)
21) CEIL
22) CEIL(-5 2)
23) CEIL(x)
24) CEILING() and FLOOR()
25) COS
26) COS() function returns the cosine of the numeric expression argument that is passed to it
27) COS(45 3 1415926)
28) COS(x)
29) COSH
30) COSH() function returns the hyperbolic cosine of numeric expression
31) COSH(x)
32) EXP
33) EXP() returns e raised to the nth power (n is the numeric_expression value), where e is equal to approximately 2 71
34) EXP(2)
35) EXP(x)
36) FLOOR
37) FLOOR(x)
38) Get the log of 8, base 2
39) Get the square root
40) GREATEST() returns the greatest of the list of expressions
41) GREATEST(126,1482,73) LEAST(126,1482,73)
42) HEXTORAW(x)
43) In Oracle, when the second value is a 0, the MOD function returns the first value
44) LN
45) LN(x)
46) LOG
47) LOG(2, 5)
48) LOG(x, y)
49) MOD
50) MOD() returns the remainder of numeric_expression1 divided by numeric_expression2
51) MOD(8, 4)
52) MOD(x, y)
53) POWER
54) POWER(100,0 5)
55) POWER(2, 3)
56) POWER(2,3) POWER(-2,3) MOD(8,3) MOD(13,0)
57) POWER(x, y)
58) ROUND
59) Round an AVG function
60) Round date to day
61) Round Demo
62) Round price as new price
63) Round result from months_between
64) ROUND with precision
65) Round(345 678), ceil(345 678), floor(345 678)
66) ROUND(44 647, -1)
67) ROUND(5 75)
68) ROUND(Number,0)
69) ROUND(Number,1)
70) ROUND(Number,-1)
71) Round(sqrt(sal),2)
72) Rounding Up and Down
73) Rounds 7
74) Rounds May 25, 2005, to the first day in the nearest month
75) Select abs(13 4) from dual
76) Select abs(-4 5) from dual
77) Select abs(-70 415) Using an expression
78) Select ceil( -1 99 )from dual
79) Select ceil( 10 00000000001 ) from dual
80) Select greatest( 1, 5, 10 )
81) Select greatest( A, a )from dual
82) Select greatest( ONE, 1 )
83) Select least( A, B, C ) from dual
84) Select least( X, x ) from dual
85) Select mod( 150 12, 2 6 )
86) Select power( 5 2, 2 7 ) With Reals
87) Select power( -5, 3 ) Using Negatives
88) Select sign( 100 - ( 50 2 ) ) Using expressions
89) Select sign( 123 -1 + 122) Using expressions
90) Select trunc( 12345 67890 )
91) Select trunc( 12345 67890, 2 )
92) SIGN
93) SIGN(0)
94) SIGN(5)
95) -SIGN(x)
96) SIN
97) SIN(0)
98) SIN(303 14159265180) TANH(0 5) EXP(4) LOG(2,32) LN(32)
99) SINH
100) SINH(1)
101) Simple demo for ROUND
102) Specifying negative precision will round numbers on the left side of the decimal point, as shown here
103) SQRT() extracts the square root from the input argument
104) SQRT(5)
105) SQRT(x)
106) Syntax
107) TAN
108) TAN() returns the tangent of the numeric expression argument passed to it
109) TAN(x)
110) TANH
111) TANH() function returns the hyperbolic tangent of numeric expression
112) TANH(x)
113) The ABS() function returns the absolute value of a numeric input argument
114) The ACOS() function is used to return the arccosine of the numeric expression passed to it
115) The ASIN() function returns the arcsine of the numeric expression passed to it
116) The value 109 29 was truncated to the single digit on the left side of the decimal point
117) This script demonstrates the Greatest functions
118) This script demonstrates the Least functions
119) TRUNC
120) TRUNC Demo
121) TRUNC with precision
122) TRUNC() returns its argument truncated to the number of decimal places specified with the second argument
123) TRUNC(44 647, 0)
124) TRUNC(44 647, -1)
125) TRUNC(Number,1)
126) TRUNC(Number,-1)
127) TRUNC(x [, y]) Returns the result of truncating x an optional y decimal places
128) Use ABS in PLSQL statement
129) Use floor(), mod() and date calculation to show how many weeks and days an employee has been working here
130) Use least() to limit the value
131) Use mod() function to get all event employee id
132) Use ROUND function in PLSQL
133) Use SIGN in PLSQL statement
134) Use sign function in user-defined function
135) Use TRUNC in PLSQL